package com.cfets.annualAssessment.service;

import com.cfets.annualAssessment.entity.CfetsPpt;
import com.cfets.annualAssessment.mapper.CfetsPptMapper;
import com.cfets.annualAssessment.mapper.CfetsPicsMapper;
import com.cfets.annualAssessment.util.CheckUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author DavidSun
 * @create 2019-01-10 14:56
 * @desc cfetsppt的服务，功能
 **/
@Service
public class CfetsPptService {
    @Autowired
    private CfetsPptMapper cfetsPptMapper;
    public List<CfetsPpt> getList(CfetsPpt cfetsPPT){
        Example example = new Example(CfetsPpt.class);
        Example.Criteria criteria = example.createCriteria();
        if (!CheckUtil.isEmpty(cfetsPPT.getMessages())){
            criteria.andLike("messages","%"+cfetsPPT.getMessages()+"%");
        }
        if (!CheckUtil.isEmpty(cfetsPPT.getPic())){
            criteria.andLike("pic","%"+cfetsPPT.getPic()+"%");
        }
        return cfetsPptMapper.selectByExample(example);
    }
}
